package com.bluejie.springBoot.controller;

import com.bluejie.springBoot.entity.business.User;
import com.bluejie.springBoot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by bluej on 2018-03-18.
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/id")
    public User getUser(Integer id){
        return userService.getById(id);
    }
    @RequestMapping("/name")
    public User getUser(String name){
        return userService.getByName(name);
    }

    @RequestMapping("/name_status")
    public User getUser(String name,int status){
        System.out.println("--123456--");
        return userService.getUserByNameAndStatus(name,status);
    }
}
